{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "8b671ff0",
   "metadata": {},
   "source": [
    "# 本周任务(参考周二上午班week12)\n",
    "\n",
    "## 优化ASR（自动语音识别）机器人\n",
    "## 链接图灵机器人\n",
    "## 语音合成"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c9784980",
   "metadata": {},
   "source": [
    "# 优化ASR（自动语音识别）机器人"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4a2994d7",
   "metadata": {},
   "outputs": [],
   "source": [
    "API_KEY = '8edRnx7Z6Iqn0E22tzTXA7vx'\n",
    "SECRET_KEY = 'LZ7UyzLBG3knd5WwG2HY1UKo2Sg9jikU'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "3bc36e8e",
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'bdasr'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-5-4a1f52e75d28>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mbdasr\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mfetch_token\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0masr\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'bdasr'"
     ]
    }
   ],
   "source": [
    "from bdasr import fetch_token,asr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "329d4e7b",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'fetch_token' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-6-ef7304970ae2>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mxu_token\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfetch_token\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mAPI_KEY\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mSECRET_KEY\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[0mxu_token\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'fetch_token' is not defined"
     ]
    }
   ],
   "source": [
    "xu_token = fetch_token(API_KEY,SECRET_KEY)\n",
    "xu_token"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "01f95810",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d657678b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "25b327f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'reqType': 0,\n",
       " 'perception': {'inputText': {'text': '附近的酒店'},\n",
       "  'inputImage': {'url': 'imageUrl'},\n",
       "  'selfInfo': {'location': {'city': '北京', 'province': '北京', 'street': '信息路'}}},\n",
       " 'userInfo': {'apiKey': '', 'userId': ''}}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "{\n",
    "\t\"reqType\":0,\n",
    "    \"perception\": {\n",
    "        \"inputText\": {\n",
    "            \"text\": \"附近的酒店\"\n",
    "        },\n",
    "        \"inputImage\": {\n",
    "            \"url\": \"imageUrl\"\n",
    "        },\n",
    "        \"selfInfo\": {\n",
    "            \"location\": {\n",
    "                \"city\": \"北京\",\n",
    "                \"province\": \"北京\",\n",
    "                \"street\": \"信息路\"\n",
    "            }\n",
    "        }\n",
    "    },\n",
    "    \"userInfo\": {\n",
    "        \"apiKey\": \"\",\n",
    "        \"userId\": \"\"\n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3ce36fc0",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "f8933b0b",
   "metadata": {},
   "source": [
    "# 语音合成"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0ba5f6c2",
   "metadata": {},
   "outputs": [],
   "source": [
    "TTS_URL = "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
